package helper

import "encoding/json"

func ToObject(sourceObj interface{}, destPtr interface{}) error {
	bytes, err := json.Marshal(sourceObj)
	if err != nil {
		return err
	}
	return json.Unmarshal(bytes, destPtr)
}
